<!--conf
<sample>
               <product version="1.4" edition="std"/>
                       <modifications>
                               <modified date="070101"/>
                       </modifications>
               </sample>
 --> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Decrease memory usage</title>
	
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
</head>

<body>

<h1>Decrease memory usage</h1>
<p>dhtmlxGrid from version 1.1 automatically clears used memory on unload method to prevent memory leaks.<br/>
In case of "never-reloading" type of app you can clear memory manually.</p>

<div id="gridbox" style="width:600px;height:270px;background-color:white;"></div>
<br>
<a href="javascript:void(0)" onclick="mygrid.destructor(); this.style.display='none'">Call grid's destructor</a>
	
<script>

	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../../codebase/imgs/");
	mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
	mygrid.setInitWidths("50,150,120,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("dyn,ed,ed,price,ch,co,ra,ro");
    mygrid.getCombo(5).put(2,2);
	mygrid.setColSorting("int,str,str,int,str,str,str,date")
	
	mygrid.init();
	mygrid.setSkin("dhx_skyblue");
	mygrid.loadXML("../common/grid.xml");

</script>

</body>
</html>
